import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import eventBus from "./bus"
import globalComponents from "./components/components"
import { defineAsyncComponent } from "vue"
import VScaleScreen from 'v-scale-screen'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);


Vue.use(VScaleScreen)
// 全局注册组件
globalComponents.forEach(component => {
  // console.log(component)
  Vue.component(component.name, defineAsyncComponent(
    () => import(`./components/${component.name}.vue`)
  ))
})


Vue.config.productionTip = false
Vue.prototype.$bus = eventBus
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
